
Public Class Form1
    Dim obj As ObjUtils = New ObjUtils
    Dim drFile as String
    Private ConnectionString As String = _
      "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;" & _
      "Dbq=" & Application.StartupPath & "\test.xls;"
    Private Function getListSheet()
        Dim objExcel As Excel.Application
        Dim objWorkBook As Excel.Workbook
        Dim totalWorkSheets As Excel.Worksheet
        Dim objWorkSheets As Excel.Worksheet
        Dim ExcelSheetName As String = ""
        Dim myWorkBook As Excel.Workbook

        objExcel = CreateObject("Excel.Application")
        objWorkBook = objExcel.Workbooks.Open("C:\myExcel.xls")

        ' this code gets the names off all the worksheets 
        For Each totalWorkSheets In myWorkBook.Worksheets
            ExcelSheetName += totalWorkSheets.Name
            MessageBox.Show(ExcelSheetName)
        Next totalWorkSheets
    End Function
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Dim Con As New Odbc.OdbcConnection(ConnectionString)
        'Dim CmdSelect As New Odbc.OdbcCommand("SELECT * FROM [Sheet1$]", Con)
        'Dim Adapter As New Odbc.OdbcDataAdapter(CmdSelect)
        'Dim Ds As New DataSet
        'Try
        '    Con.Open()
        '    Adapter.Fill(Ds, "Sheet1")
        'Catch Err As Exception
        '    MessageBox.Show(Err.ToString())
        'Finally
        '    Con.Close()
        'End Try
        'grid.DataSource = Ds.Tables("Sheet1")
        'Me.UltraGrid1.DataSource = Ds.Tables("Sheet1")
        'obj.addObject(New ObjUtils(Me.UltraGrid1, ObjUtils._None))
        'obj.setGiaoDien()
        getListSheet()
    End Sub

End Class